#ifndef __FLASH_MGR_H__
#define __FLASH_MGR_H__

#include "stm32f10x.h"
/*
 * 车型数据使用前8个sector
 * 每一个车型限制使用4个page,
 * 定义为一个block = 4*256 = 1024bytes
 *
 * */

#define SECTOR_SIZE         16
#define PAGES_PER_SECTOR    256
#define PAGE_SIZE           256
#define PAGES_PER_BLOCK     4

typedef enum {
    UNUSED,
    UNSED,
};

typedef enum {
    PROTOCOL_TYPE_STD_CAN,
} ProtocolTypeEnum;

#define BLOCK_SIZE          ((SECTOR_SIZE * PAGES_PER_SECTOR) / PAGES_PER_BLOCK)

typedef struct __block {
    uint8_t used;
    uint8_t index;
    char name[8];
    uint8_t type;
} VehilceBlock;

#endif
